import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    isCollapse: false,
    collapseClass:'navbar',
    username:'',
    menulist:[]

  },
  getters: {
  },
  mutations: {
     changeIsCollapse(state){
        state.isCollapse = !state.isCollapse
     },
    changeCollapseClass(state){
       if(state.isCollapse){
        state.collapseClass = 'navbar navbar-collapse'
       }else{
         state.collapseClass = 'navbar'
       }
    },
     getusername(state){
         state.username=window.sessionStorage.getItem("nickName")
     },
      getMenuList(state,list){
         state.menulist=list
      }
  },
  actions: {

  },
  modules: {
  }
})
